package org.framework.customutil;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * @Title: ExceptionUtil.java .<br>
 * @Package org.framework.customutil .<br>
 * @Description: Exception工具类 .<br>
 * @author 郑成功 .<br>
 * @email a876459952@qq.com .<br>
 * @date 2018-6-7 下午9:41:41.<br>
 * @version V1.0.<br>
 */
public class ExceptionUtil {

	/**
	 * @Description: 返回错误信息字符串 .<br>
	 * @param ex .<br>   
	 * @author 郑成功 .<br>
	 * @date 2018-6-7 下午9:41:54.<br>
	 */
	public static String getExceptionMessage(Exception ex) {
		StringWriter sw = new StringWriter();
		PrintWriter pw = new PrintWriter(sw);
		ex.printStackTrace(pw);
		pw.flush();
		pw.close();
		return sw.toString();
	}

}
